/*
 * MainFrame.java
 *
 * Created on 3-Mar-2009, 1:49:43 PM
 */
package display;

import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import physics.*;

/**
 *
 * @author peter
 */
public class MainFrame extends JFrame {
	Display display;
	static Engine engine;

	MainFrame(GraphicsConfiguration graphicConf)
	{
		super(graphicConf);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setIgnoreRepaint(true);
		setFocusCycleRoot(false);

		engine = new Engine(this);
		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e)
			{
				engine.setRunning(false);
				System.exit(0);
			}
		});

		setFocusable(true);
	}

	public static void main(String args[])
	{
		GraphicsEnvironment graphEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
		GraphicsDevice graphDevice = graphEnv.getDefaultScreenDevice();
		GraphicsConfiguration graphicConf = graphDevice.getDefaultConfiguration();
		new MainFrame(graphicConf).setVisible(true);

		engine.start();
	}
}
